home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / itcl1_31.z / itcl1_31 / tcldev / itcl-1.3 / README < prev   
Encoding:
Text File  |  1993-10-15  |  7.1 KB  |  197 lines

  1.  
  2. ------------------------------------------------------------------------
  3.                       [incr Tcl] - version 1.3
  4. ------------------------------------------------------------------------
  5.   This version will only work with Tcl version 7.0 and beyond.
  6.   At this point, it has only been tested with version 7.0.
  7.  
  8.   Please send comments or suggestions to michael.mclennan@att.com.
  9. ========================================================================
  10.               Copyright (c) 1993   AT&T Bell Laboratories
  11. ========================================================================
  12. Permission to use, copy, modify, and distribute this software and its
  13. documentation for any purpose and without fee is hereby granted,
  14. provided that the above copyright notice appear in all copies and that
  15. both that the copyright notice and warranty disclaimer appear in
  16. supporting documentation, and that the names of AT&T Bell Laboratories
  17. any of their entities not be used in advertising or publicity
  18. pertaining to distribution of the software without specific, written
  19. prior permission.
  20.  
  21. AT&T disclaims all warranties with regard to this software, including
  22. all implied warranties of merchantability and fitness.  In no event
  23. shall AT&T be liable for any special, indirect or consequential
  24. damages or any damages whatsoever resulting from loss of use, data or
  25. profits, whether in an action of contract, negligence or other
  26. tortuous action, arising out of or in connection with the use or
  27. performance of this software.
  28. ========================================================================
  29.  
  30.  
  31. Implementation Notes:
  32.  
  33. [incr Tcl] adds object-oriented programming facilities to Tcl.  It
  34. was NOT designed as yet another whiz-bang object-oriented programming
  35. language; indeed, it is patterned somewhat after C++.  It was designed
  36. to support more structured programming in Tcl.  Scripts that grow
  37. beyond a few thousand lines become extremely difficult to maintain.
  38. [incr Tcl] attacks this problem in the same way that any object-
  39. oriented programming language would, by providing mechanisms for
  40. data encapsulation behind well-defined interfaces.  In many cases,
  41. ideas for new widgets or objects can be prototyped using [incr Tcl],
  42. and if necessary, the code can be translated to C for more efficient
  43. execution; the public (Tcl) interface, however, could remain unchanged.
  44.  
  45.  
  46. READ THE INTRO:
  47.  
  48. A tutorial explanation of [incr Tcl] is presented in the PostScipt
  49. file "Intro.ps".  This tutorial describes a family of "Toaster"
  50. classes that illustrate many of the features available in this package.
  51. Source code for the example classes is provided in "demos/toasters".
  52.  
  53.  
  54. INSTALLATION AND TESTING:
  55.  
  56.   1)  Obtain this distribution from harbor.ecn.purdue.edu:
  57.  
  58.         ftp harbor.ecn.purdue.edu
  59.         cd tcl/extensions
  60.         binary
  61.         get itcl-1.3.tar.Z
  62.         quit
  63.  
  64.   2)  Uncompress and untar the distribution:
  65.  
  66.         uncompress itcl-1.3.tar.Z
  67.         tar xvf itcl-1.3.tar
  68.  
  69.   3)  Run the configuration script:
  70.  
  71.         cd itcl-1.3
  72.         ./configure
  73.  
  74.       or, for systems that don't recognize "#!" in shell scripts:
  75.  
  76.         cd itcl-1.3
  77.         /bin/sh ./configure
  78.  
  79.       You may be queried for the location of Tcl/Tk include files
  80.       and libraries.  Note that this package also requires the
  81.       path to the Tcl source code, since it requires "tclInt.h"
  82.       and this file is not usually installed with the standard
  83.       include files.
  84.  
  85.       The "configure" script generates new Makefiles from their
  86.       respective templates (Makefile.in).
  87.  
  88.       If "configure" can't find something, edit the Makefiles in
  89.       "src/" and "man/" by hand and insert the proper paths.
  90.  
  91.   4)  Build the libraries and the executables:
  92.  
  93.         make all
  94.  
  95.   5)  Test by running the demos:
  96.  
  97.         cd demos
  98.         ../src/itcl_wish -f coloredit
  99.         ../src/itcl_wish -f listboxes
  100.  
  101.   6)  Install the libraries (libitcl.a and libitcl.so.1.3) and the
  102.       executables (itcl_sh and itcl_wish), along with the man page,
  103.       onto your system:
  104.  
  105.         make install
  106.  
  107.  
  108. ADDING [incr Tcl] TO YOUR OWN APPLICATION:
  109.  
  110.   To add [incr Tcl] facilities to a Tcl application, modify the
  111.   Tcl_AppInit() routine as follows:
  112.  
  113.   1) Include the "itcl.h" header file near the top of the file
  114.      containing Tcl_AppInit():
  115.  
  116.        #include "itcl.h"
  117.  
  118.   2) Within the body of Tcl_AppInit(), add the following lines:
  119.  
  120.        if (Itcl_Init(interp) == TCL_ERROR) {
  121.            return TCL_ERROR;
  122.        }
  123.  
  124.   3) Link your application with libitcl.a
  125.  
  126.   NOTE:  Example files "tclAppInit.c" and "tkAppInit.c" containing
  127.          the changes shown above above are included in this
  128.          distribution.
  129.  
  130.  
  131. DEMO CLASSES:
  132.  
  133. Example classes in the "demos/widgets" directory illustrate how
  134. [incr Tcl] can be used to create new widgets that look (from a
  135. programming standpoint) like normal widgets but are written entirely
  136. in Tcl.  These widgets are defined as object classes, and pack
  137. primitive widgets together to provide higher-level functionality.
  138.  
  139. Two demos are provided which illustrate how these "mega-widgets"
  140. could be used in a real application:
  141.  
  142.     demos/listboxes .... Illustrates high-level listboxes:
  143.                            - ListBox
  144.                            - SelectBox
  145.                            - FilteredBox
  146.  
  147.     demos/coloredit .... Allows colors to be changed in another
  148.                          Tk application.  Illustrates:
  149.                            - FilteredBox
  150.                            - ColorEditor
  151.  
  152. Once you have created and installed the "itcl_wish" application which
  153. recognizes [incr Tcl] facilities, you can invoke these demos as:
  154.  
  155.     % cd demos
  156.     % itcl_wish -f listboxes
  157.     % itcl_wish -f coloredit
  158.  
  159. It is necessary to sit in the "demos" directory when running these
  160. scripts, since they need to access the class definition files that
  161. reside in the "widgets" directory below.
  162.  
  163.  
  164. LIBRARY ROUTINES:
  165.  
  166. The "library" directory contains a few useful Tcl procedures:
  167.  
  168.     library/auto_mkindex.tcl .... the usual "auto_mkindex" proc
  169.                                   updated to include [incr Tcl]
  170.                                   classes when building an index
  171.  
  172.     library/itcl_reload.tcl ..... a series of procedures for
  173.                                   unloading and reloading class
  174.                                   definitions; useful when debugging
  175.                                   [incr Tcl] applications.
  176.  
  177.  
  178. SUMMARY:
  179.  
  180. Widgets provide a natural domain for object-oriented programming
  181. techniques.  They are not, however, the only domain.  I believe that
  182. [incr Tcl] can be used in more diverse applications to add structure
  183. to Tcl programs.  The "itcl_class" mechanism should be used to group
  184. related procedures and their shared data into a neat little package
  185. with a well-defined interface.
  186.  
  187. Please experiment with this facility and send me your comments.
  188.  
  189. --Michael
  190.  
  191.     =--===   ///////////////////////////////////////////////////////////
  192.   =-----====   Michael J. McLennan 2C-226    michael.mclennan@att.com 
  193.  =------=====  AT&T Bell Laboratories
  194.  ==----======  1247 S Cedar Crest Blvd        Phone: (215) 770-2842
  195.   ==========   Allentown, PA  18103             FAX: (215) 770-3843
  196.     ======   ///////////////////////////////////////////////////////////
  197.